home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 46 / Amiga Format CD46 (1999-10-20)(Future Publishing)(GB)[!][issue 1999-12].iso / -in_the_mag- / reader_requests / scilab / tests / residu.dia.ref < prev    next >
Text File  |  1999-09-16  |  606b  |  34 lines

  1.  
  2. Leps=1.e-7;
  3.  
  4. s=poly(0,'s');
  5.  
  6. p=(s-1)*(s+1)*(s+2)*(s+10);
  7.  
  8. a=(s-5)*(s-1)*(s*s)*((s+1/2)**2);
  9.  
  10. b=(s-3)*(s+2/5)*(s+3);
  11.  
  12. if residu(p,a,b)+(531863/4410) > Leps then bugmes();quit;end
  13.  
  14. z=poly(0,'z');
  15.  
  16. a=z^3+0.7*z^2+0.5*z-0.3;
  17.  
  18. b=z^3+0.3*z^2+0.2*z+0.1;
  19.  
  20. deff('[ptild]=tilde(p,s)','c=coeff(p),n=degree(p)+1,c=c(n:-1:1),...
  21. s=poly(0,s),ptild=0,...
  22. for k=1:n,ptild=ptild+c(k)*s^(k-1),end')
  23.  
  24. atild=tilde(a,'z');
  25.  
  26. btild=tilde(b,'z');
  27.  
  28. if residu(b*btild,z*a,atild)-2.9488038 > Leps then bugmes();quit;end
  29.  
  30. a=a+0*%i;b=b+0*%i;
  31.  
  32. if real(residu(b*btild,z*a,atild)-2.9488038) > Leps then bugmes();quit;end
  33.  
  34.